//package com.team.auth.config.security.filter;
//
//import com.team.common.base.Common;
//import org.springframework.security.core.Authentication;
//import org.springframework.security.core.context.SecurityContextHolder;
//import org.springframework.web.filter.OncePerRequestFilter;
//
//import javax.servlet.FilterChain;
//import javax.servlet.ServletException;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.io.IOException;
//
//
//public class TokenFilter extends OncePerRequestFilter {
//    @Override
//    protected void doFilterInternal(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, FilterChain filterChain) throws ServletException, IOException {
//        String token = httpServletRequest.getHeader("token");
//        if (token!=null){
//            Object object = RedisUtil.getObject(Common.SESSION_FIELD + token);
//            if (object!=null){
//                SecurityContextHolder.getContext().setAuthentication((Authentication)object);
//            }
//        }
//        filterChain.doFilter(httpServletRequest,httpServletResponse);
//    }
//}
